/**
作者：漫小猫
QQ ：2535080855
博客：www.lxbkw.com
邮箱：manxiaomao@qq.com
*/
		window.onload = function() {
			if(window.screen.width <= 600){
					document.getElementsByTagName("body")[0].style.background = "url(http://api.brhsm.cn/tp.png?img=dmbg)";
			}else{
					document.getElementsByTagName("body")[0].style.background = "url(http://api.brhsm.cn/tp.png)";
					setInterval("bg()", "30000"); //背景图片运行时间
			}
			function bg() { //百变背景图片方法
				document.getElementsByTagName("body")[0].style.background = "url(http://api.brhsm.cn/tp.png?" + (Math.random() * 999) + ")";
			}
			
		var mm = document.getElementsByName("mm")[0];
		
			mm.onfocus = function() { //密码框获得焦点运行方法
			document.getElementById("dl").getElementsByTagName("img")[0].src = "./static/img/z.jpg";
			var v1 = mm.value;
			if(v1.length == 0) {
				document.getElementById("dl").getElementsByTagName("img")[0].style.transform = "rotate(30deg)";
			} else {
				document.getElementById("dl").getElementsByTagName("img")[0].style.transform = "rotate(" + (30 - (v1.length * 5)) + "deg)";
			}
		}
			mm.onblur = function() { //密码框失去焦点运行方法
			document.getElementById("dl").getElementsByTagName("img")[0].src = "http://q1.qlogo.cn/g?b=qq&nk=2535080855&s=100";
			document.getElementById("dl").getElementsByTagName("img")[0].style.transform = "rotate(0deg)";
		}
		mm.oninput = function() { //密码框输入时触发运行方法
			var v1 = mm.value;
			if(v1.length >= 12) {
				document.getElementById("dl").getElementsByTagName("img")[0].style.transform = "rotate(" + (30 - (12 * 5)) + "deg)";
			} else {
				document.getElementById("dl").getElementsByTagName("img")[0].style.transform = "rotate(" + (30 - (v1.length * 5)) + "deg)";
			}
		}
		}        
        document.oncontextmenu = function () { return false; };//右键触发事件
        document.onkeydown=function (e){//按键触发事件
        var currKey=0,evt=e||window.event;
        currKey=evt.keyCode||evt.which||evt.charCode;
        if (currKey == 123) {
            window.event.cancelBubble = true;
            window.event.returnValue = false;
        }
    }	